<%--
  Created by IntelliJ IDEA.
  User: 李明忠
  Date: 2025/9/1
  Time: 1:12
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.zhongge.entity.User, java.util.List" %>
<%@ page import="java.io.Writer" %>
<%
    List<User> users = (List<User>) request.getAttribute("users");
%>
<html>
<head>
    <title>用户列表</title>
    <style>
        body { font-family: Arial, sans-serif; margin: 40px; }
        table { width: 100%; border-collapse: collapse; margin-top: 20px; }
        th, td { border: 1px solid #ddd; padding: 12px; text-align: left; }
        th { background-color: #f2f2f2; }
        tr:nth-child(even) { background-color: #f9f9f9; }
        .container { max-width: 800px; margin: 0 auto; }
    </style>
</head>
<body>
<div class="container">
    <h2>用户列表</h2>
    <table>
        <thead>
        <tr>
            <th>ID</th>
            <th>用户名</th>
            <th>邮箱</th>
        </tr>
        </thead>
        <tbody>
        <% for (User user : users) { %>
        <tr>
            <td><%= user.getId() %></td>
            <td><%= user.getUsername() %></td>
            <td><%= user.getEmail() %></td>
        </tr>
        <% } %>
        </tbody>
    </table>
    <p><a href="register.jsp">返回注册页面</a></p>
</div>
</body>
</html>
